import 'package:http/http.dart' as http;
import 'dart:convert';

import 'package:u9mobile/config/application.dart';


Future<void> fetchData() async {
  // 发送GET请求
  final response = await http.get(Uri.parse(baseUrl));

  // 检查响应的状态码
  if (response.statusCode == 200) {
    // 解析JSON数据
    final jsonData = json.decode(response.body);
    print('Title: ${jsonData['title']}');
    print('Body: ${jsonData['body']}');
  } else {
    // 处理错误情况
    print('请求失败，状态码：${response.statusCode}');
  }
}
